MyLogger = function() {
};

MyLogger.prototype.log = function(txt) {
    console.log(txt);
};

MyLogger.prototype.logThis = function() {
    this.log(this);
};

//--------
function dataTypes() {
    logType(1);
    logType(0.1);
    logType(null);
    logType(undefined);
    logType("Hello");
    logType((typeof this));
    logType(new Date());
    logType(arr);
    logType(arr2);
    logType(jsonObj);
    logType(doc);
    logType(this);
    logType(MyLogger);
    logType(new MyLogger());
    var b = document.getElementById("myDiv");
    logType(b);
    logType(document);
}

function logType(obj) {
    if (obj === null) {
        ml.log("Type: " + (typeof obj));
    } else if (obj === undefined) {
        ml.log("Type: " + (typeof obj));
    } else {
        ml.log("Type: " + (typeof obj) + ":" + (obj.constructor.name));
    }
}

var arr = new Array();
var arr2 = ["One", "Two"];
var jsonObj = {"one": "One", "two": "Two"};
var ns = {"has": {"ee": {"lib": {"class": null}}}};
var doc = document;
var me = this;
var ml = new MyLogger();
var globFunction = function() {
    return true;
};
ml.log("Hola");
ml.logThis();
ml.log(me);
ml.log(doc);
ml.log(arr);
ml.log(arr2);
ml.log(ns);
arr[arr.length] = "Additional";
arr2[arr2.length] = "Additional";
jsonObj[jsonObj.length] = "Additional";
jsonObj[jsonObj.length] = "Additional1";
ml.log(arr);
ml.log(arr2);
arr2.some = "Hoo";
arr2.foo = function(i) {
    var vhat = i;
};
jsonObj.some = "Hoo";
jsonObj.foo = function(i) {
    var vhat = i;
};
arr2.fromGlob = globFunction;
jsonObj.fromGlob = globFunction;
ml.log(arr2);
ml.log(jsonObj);
ml.log("===Logging all attributes of arr2===");
for (var pos in arr2) {
    ml.log(arr2[pos]);
}
ml.log("===Logging all attributes of arr2 with has obj.hasOwnProperty(prop)===");
for (var pos in arr2) {
    if (arr2.hasOwnProperty(pos)) {
        ml.log("\tOwn: ");
        ml.log(arr2[pos]);
    } else {
        ml.log("\tNot own: ");
        ml.log(arr2[pos]);
    }
}
ml.log("===Logging all attributes of jsonObj===");
for (var pos in jsonObj) {
    ml.log(jsonObj[pos]);
}
ml.log("===Logging all attributes of jsonObj with has obj.hasOwnProperty(prop)===");
for (var pos in jsonObj) {
    if (jsonObj.hasOwnProperty(pos)) {
        ml.log("\tOwn: ");
        ml.log(jsonObj[pos]);
    } else {
        ml.log("\tNot own: ");
        ml.log(jsonObj[pos]);
    }
}

function runnerOfButton() {
    dataTypes();
}
